package com.qqt.csr.im.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * im房间
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Accessors(chain = true)
@JsonIgnoreProperties(ignoreUnknown = true)
@TableName(value = "csr_im_room")
public class Room implements Serializable {

    @Serial
    private static final long serialVersionUID = 8665369092711146793L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 最新的会话id
     */
    @TableField(value = "last_conversation_id")
    private String lastConversationId;

    /**
     * 最近会话状态，0：结束，1：正常
     */
    @TableField(value = "last_conversation_state")
    private Integer lastConversationState;

    /**
     * 最近会话创建时间
     */
    @TableField(value = "last_conversation_date")
    private Date lastConversationDate;

    /**
     * 房间名
     */
    @TableField(value = "name")
    private String name;

    /**
     * 扩展 json格式
     */
    @TableField(value="ext")
    private String ext;

    /**
     * 是否删除：0 否；1 是
     */
    @TableField(value = "delete_flag")
    private Integer deleteFlag;

    /**
     * 创建时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    private List<RoomMember> roomMemberList;
}
